package com.mxfcode.front.bbs_login.service;

import com.mxfcode.entity.TSLoginTicket;
import com.mxfcode.entity.TSUser;

import java.util.Map;

/**
 * @author moxiufeng
 * @date 2021/2/16 16:49
 */
public interface LoginService {

    /**
     * 注册
     * @param user
     * @return
     */
    Map<String,Object> register(TSUser user) throws Exception;

    /**
     * 激活账号
     * @param userId
     * @param code
     * @return
     */
    int activation(String userId, String code);

    /**
     * 用户登录
     * @param username
     * @param password
     * @param expiredSeconds
     * @return
     */
    Map<String, Object> login(String username, String password, long expiredSeconds) throws Exception;

    /**
     * 通过ticket获取TSLoginTicket值
     * @param ticket
     * @return
     */
    TSLoginTicket findLoginTicket(String ticket);

    /**
     * 通过userid查询TSUser
     * @param userId
     * @return
     */
    TSUser findUserById(String userId);
}
